<template>
    <div>
        <div class="tabNav">
            <router-link to="/index">
                <img src="../assets/img/sidebar1.png" />首页
            </router-link>
            <b>/<img src="../assets/img/lhyg.png" />灵活用工平台</b>
            <el-input
                placeholder="请输入灵活用工平台名称进行搜索"
                suffix-icon="el-icon-search"
                @change="searchMethods"
                v-model="searchValue">
            </el-input>
            <em v-if="Object.keys(numberObj).length > 0"><i style="font-size: 16px;margin-right: 5px;" class="el-icon-s-data"></i>灵活用工平台数量：{{ numberObj.platformNum }} API对接：{{ numberObj.apiToPlatformNum }} OEM对接：{{ numberObj.oemToPlatformNum }}</em>
        </div>
        <el-row :gutter="24">
            <el-col :span="24">
                <el-card class="cardTits cardTitss cardTitdd" shadow="hover">
                    <lhyg-table ref="searchMethods" :search="searchValue"></lhyg-table>
                </el-card>
            </el-col>
        </el-row>
    </div>
</template>

<script>
import LhygTable from '../components/table/LhygTable.vue'
export default {
    name: "dashboard",
    data() {
        return {
            currentPage4: 50,
            name: localStorage.getItem("ms_username"),
            value: '',
            searchValue: '',
			numberObj: {}
        };
    },
    components: {
		LhygTable
    },
    computed: {
        role() {
            return this.name === "admin" ? "超级管理员" : "普通用户";
        }
    },
    mounted() {
        this.getinfoData();
    },
    methods: {
        searchMethods() {
			// 搜索
			this.$refs.searchMethods.getTableData()
		},
        getinfoData() {
            // 用工平台类型数量统计
            this.$http({
                url: '/api/platform/selectPlatformListByName',
               method: 'post',
				headers: {
					'Content-Type': 'application/json'
				}
			}).then(data => {
				if(data.code === 0) {
					this.numberObj = data.result
					// this.numberObj = data.result.apiToPlatformNum
     //                this.oemToPlatformNum = data.result.oemToPlatformNum
     //                this.platformNum = data.result.platformNum
				}
			})
        },
        handleSizeChange(val) {
            console.log(`每页 ${val} 条`);
        },
        handleCurrentChange(val) {
            console.log(`当前页: ${val}`);
        },
        open() {
            this.$confirm('', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
            }).then(() => {
            
            }).catch(() => {
                
            });
        }
    }
};
</script>
<style scoped>
	.el-row {
		margin-bottom: 20px;
	}
</style>
